package com.quanyan.stadium.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by xiaoxiao on 16/6/2.
 *
 * 赛事类型
 */
public enum GameTypeConfigEnum implements BaseEnum{


    CONFIG_GAME_EVENT_TYPE_NGKC(0, "GAME_EVENT_TYPE", "赛事类型","官方赛"),
    CONFIG_GAME_EVENT_TYPE_PLACE(1, "GAME_EVENT_TYPE", "赛事类型","月度场馆赛"),
    CONFIG_GAME_EVENT_TYPE_PERSONAL(2, "GAME_EVENT_TYPE", "赛事类型","个人赛"),
    CONFIG_GAME_EVENT_TYPE_SCENE(3, "GAME_EVENT_TYPE", "赛事类型","现场比赛"),
    CONFIG_GAME_EVENT_TYPE_INTERNAL(4, "GAME_EVENT_TYPE", "赛事类型","内部赛"),
    CONFIG_GAME_EVENT_TYPE_BIG(5, "GAME_EVENT_TYPE", "赛事类型","俱乐部赛");


    private int id;

    private String code;

    private String name;

    private String label;

    GameTypeConfigEnum(int id, String code, String name, String label){
        this.id = id;
        this.code = code;
        this.name = name;
        this.label = label;
    }

    @Override
    public int getId() {
        return this.id;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public String getLabel() {
        return this.label;
    }

    public static Map<String,String> getSysConfigEnumMap(){
        Map<String,String> sysConfigMap = new HashMap<String,String>();
        for (GameTypeConfigEnum tmpEnum : GameTypeConfigEnum.values()) {
            sysConfigMap.put(tmpEnum.getCode(), tmpEnum.getName());
        }
        return sysConfigMap;
    }

    public static GameTypeConfigEnum getSysConfigEnum (int id){
        GameTypeConfigEnum gameTypeConfigEnum;
        if (CONFIG_GAME_EVENT_TYPE_NGKC.getId() == id){
            gameTypeConfigEnum = GameTypeConfigEnum.CONFIG_GAME_EVENT_TYPE_NGKC;
        } else if(CONFIG_GAME_EVENT_TYPE_PLACE.getId() == id){
            gameTypeConfigEnum = GameTypeConfigEnum.CONFIG_GAME_EVENT_TYPE_PLACE;
        } else if(CONFIG_GAME_EVENT_TYPE_PERSONAL.getId() == id){
            gameTypeConfigEnum = GameTypeConfigEnum.CONFIG_GAME_EVENT_TYPE_PERSONAL;
        } else if(CONFIG_GAME_EVENT_TYPE_SCENE.getId() == id){
            gameTypeConfigEnum = GameTypeConfigEnum.CONFIG_GAME_EVENT_TYPE_SCENE;
        } else if(CONFIG_GAME_EVENT_TYPE_INTERNAL.getId() == id){
            gameTypeConfigEnum = GameTypeConfigEnum.CONFIG_GAME_EVENT_TYPE_INTERNAL;
        } else if (CONFIG_GAME_EVENT_TYPE_BIG.getId() == id){
            gameTypeConfigEnum = GameTypeConfigEnum.CONFIG_GAME_EVENT_TYPE_BIG;
        } else {
            gameTypeConfigEnum = GameTypeConfigEnum.CONFIG_GAME_EVENT_TYPE_NGKC;
        }

        return gameTypeConfigEnum;
    }
}
